import request from "@/utils/request";

// 查询圈子列表
export function listCircle(query) {
  return request({
    url: "/pc/circle/pageList",
    method: "get",
    params: query,
  });
}

// 查询圈子列表
export function listMyCircle(query) {
  return request({
    url: "/pc/circle/list",
    method: "get",
    params: query,
  });
}

// 新增或修改圈子
export function addOrUpdateCircle(data) {
  return request({
    url: "/pc/circle/addOrUpdate",
    method: "post",
    data: data,
  });
}

// 查询圈子详细
export function getCircle(id) {
  return request({
    url: "/pc/circle/info?id=" + id,
    method: "get",
  });
}

// 删除圈子
export function delCircle(id) {
  return request({
    url: "/pc/circle/delete?id=" + id,
    method: "delete",
  });
}

// 查询圈子列表
export function setRule(type, circleId) {
  return request({
    url: "/pc/circle/rule?type=" + type + "&&circleId=" + circleId,
    method: "get",
  });
}

// 查询圈子列表
export function setAdmin(id, isAdmin) {
  return request({
    url: "/pc/circle/admin?id=" + id + "&&isAdmin=" + isAdmin,
    method: "get",
  });
}

// 新增或修改圈子
export function editRule(data) {
  return request({
    url: "/pc/circle/editRule",
    method: "post",
    data: data,
  });
}

//圈子成员数
export function editMemberNum(memberNum, id) {
  return request({
    url: "/pc/circle/member?memberNum=" + memberNum + "&scanNum" + id,
    method: "get",
  });
}

// 圈子浏览数
export function editBrowseNum(scanNum, id) {
  return request({
    url: "/pc/circle/browse?scanNum=" + scanNum + "&scanNum" + id,
    method: "get",
  });
}

// 城市列表
export function cityList() {
  return request({
    url: "/pc/area/pageList?pageSize=1000000&pageNum=1",
    method: "get",
  });
}
